<?php

return array(
	'ajaxUpdate' => false,
	'searchColumns' => array(
		'sn',
//		'type' => array('dropDownList',Yii::app()->enum->options('order.receivables')),
		'selectTime' => array('dropDownList',Yii::app()->enum->options('selectTime')),
		'receiver',
		'payer'
	),

	'dataColumns' => array(
		'order.sn',
		'receiver',
		'payer',
		'receiveable',
		'received',
//		array(
//			'name' => 'object_type',
//			'value' => 'Yii::app()->enum->lookup("dic", $data->getAttribute("object_type"))'	
//		),
//		array(
//			'name' => 'status',
//			'value' => '$data->stateHandle->lookup()',
//		),
		'create_time',
		array(
			'class' => 'ButtonColumn',
			'header' => '操作',
			'template' => '{view}'
//			'stateHandles' => array(
//				'stateHandle' => array(
//					'url' => 'Yii::app()->controller->createUrl("{$op}", array("id"=>$data->id))',
//				),
//			),
		),
	),
	'scripts' => array(
		array(null, "
			$('.pay,.receive').click(function() {
				$.dialog({
					'id': 'apply',
					'title': '收(付)款',
					'padding': '10px 10px 0 10px'
				});
				dlg = $.dialog.get('apply');
				dlg.dom.content.find('form').live('submit', function() {
					$.post(this.action, $(this).serialize(), function(result) {
						if(result == 1) window.location.href = '".Yii::app()->controller->createUrl('admin')."';
						else
							dlg.content(result);
					});
					return false;
				});
				$.get($(this).attr('href'), {}, function(result) {
					dlg.content(result);
				});
				return false;
			});
		")
	),
	'operates' => false,
	'_import' => array(
		array('*', 'actions.admin//*'),
	),
);
?>